package mythread.demo001;

public class MyThread2Test {
    public static void main(String[] args) {
        MyThread2 myrun = new MyThread2();
        myrun.setName("myThread2");
        myrun.start();

        try {
            for (int i = 0; i < 10; i++) {
                int time = (int) (Math.random() * 1000);
                Thread.sleep(time);
                System.out.println( "main-"+i + Thread.currentThread().getName());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
